package com.slofzx.nuoda.evaluation.project.enums;

import com.slofzx.nuoda.common.EnumConfig;
import com.slofzx.nuoda.common.config.Type;

/**
 * 项目级别枚举
 * mayy
 */
@EnumConfig(id="project-grade",name = "项目级别")
public enum ProjectGradeEnum implements Type {
    /**
     * 一类
     */
    FIRST("first","一类",1),
    /**
     * 二类
     */
    SECOND("second","二类",2),
    /**
     * 三类
     */
    THIRD("third","一般三类",3),
    /**
     * 重点三类
     */
    THIRD_IMPORTANT("third_important","重点三类",3),
    ;

    /**
     * 数据类型id
     */
    private String id;
    /**
     * 数据类型展示名称
     */
    private String name;

    /**
     * 排序值
     */
    private double sort;
    ProjectGradeEnum(String id, String name,double sort) {
        this.id = id;
        this.name = name;
        this.sort = sort;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public double getSort() {
        return this.sort;
    }


    /**
     * 根据id获取对应的枚举
     * @param id 枚举值的标识
     * @return
     */
    public static ProjectGradeEnum getEnum(String id){
        for(ProjectGradeEnum dataTypeEnum: ProjectGradeEnum.values()){
            if(dataTypeEnum.getId().equals(id)){
                return dataTypeEnum;
            }
        }
        return null;
    }
}
